### Alizade, Dancygier, Ditlmann 
### "National Penalties Reversed"
### Replication Code 
### Table 4 (Column 1)
### For questions, contact jalizade@princeton.edu

# empty environment
rm(list = ls())

#setwd("")
setwd("C:/Users/Jey/Dropbox/WZB/NaturalizationExperiment/Submission/JOP/replication_JOP/data")

# load necessary packages
library(readstata13)
library(lmtest)
library(sandwich)

# load data set
dat <- read.dta13("data_experimental.dta")

# regression 
mod <- lm(e1_response ~ e1_treat_turkish*e1_leftpol + e1_treat_dual*e1_leftpol + e1_treat_benefits*e1_leftpol,
          data=dat)

# robust standard errors
robust_mod <- coeftest(mod, vcov = vcovHC(mod, "HC1"))

# print results
robust_mod

### NOTE: We do not provide the data and the code to replicate column 2 of table 4  due to concerns of identifiability of politicians. ###
